﻿Imports System.Net.NetworkInformation
Imports Microsoft.Win32
Imports HMSLibrary


Class Application

    Private Sub Application_DispatcherUnhandledException(ByVal sender As Object, ByVal e As System.Windows.Threading.DispatcherUnhandledExceptionEventArgs) Handles Me.DispatcherUnhandledException
        AppCommon.LogError(e.Exception)
        e.Handled = True
    End Sub

    ' Application-level events, such as Startup, Exit, and DispatcherUnhandledException
    ' can be handled in this file.

    Private Sub Application_Startup(ByVal sender As Object, ByVal e As System.Windows.StartupEventArgs) Handles Me.Startup
        My.Settings.Item("HMSIndiaConnectionString") = AppCommon.db.ConnectionString
        'MsgBox(My.Settings.HMSIndiaConnectionString)
        'AppCommon.RegisterMe()
        CultureInfo()
    End Sub

    Private Sub CultureInfo()
        Dim culInfo As Globalization.CultureInfo = New System.Globalization.CultureInfo("en-us")
        Dim dtinfo As Globalization.DateTimeFormatInfo = New System.Globalization.DateTimeFormatInfo() With {
            .ShortDatePattern = "dd-MMM-yyyy",
            .ShortTimePattern = "hh:mm:ss tt",
            .TimeSeparator = ":",
            .MonthNames = System.Globalization.CultureInfo.InvariantCulture.DateTimeFormat.MonthNames(),
            .AbbreviatedMonthNames = System.Globalization.CultureInfo.InvariantCulture.DateTimeFormat.AbbreviatedMonthNames(),
            .DateSeparator = "-"}

        culInfo.DateTimeFormat = dtinfo
        System.Threading.Thread.CurrentThread.CurrentCulture = culInfo
    End Sub
End Class
